Integrand size = 12, antiderivative size = 112 \[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\frac {3 x^2}{8}-i x^3-\frac {3 x^4}{8}+\frac {3 \cos ^2(x)}{8}-\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)+3 x^2 \log \left (1-e^{2 i x}\right )-3 i x \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {3}{2} \operatorname {PolyLog}\left (3,e^{2 i x}\right )+\frac {3}{4} x \cos (x) \sin (x)-\frac {1}{2} x^3 \cos (x) \sin (x) \]
[Out]
Time = 0.21 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {4493, 3392, 30, 3391, 3801, 3798, 2221, 2611, 2320, 6724} \[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=-3 i x \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {3}{2} \operatorname {PolyLog}\left (3,e^{2 i x}\right )-\frac {3 x^4}{8}-i x^3-x^3 \cot (x)-\frac {1}{2} x^3 \sin (x) \cos (x)+\frac {3 x^2}{8}+3 x^2 \log \left (1-e^{2 i x}\right )-\frac {3}{4} x^2 \cos ^2(x)+\frac {3 \cos ^2(x)}{8}+\frac {3}{4} x \sin (x) \cos (x) \]
[In]
[Out]
Rule 30
Rule 2221
Rule 2320
Rule 2611
Rule 3391
Rule 3392
Rule 3798
Rule 3801
Rule 4493
Rule 6724
Rubi steps \begin{align*} \text {integral}& = -\int x^3 \cos ^2(x) \, dx+\int x^3 \cot ^2(x) \, dx \\ & = -\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)-\frac {1}{2} x^3 \cos (x) \sin (x)-\frac {\int x^3 \, dx}{2}+\frac {3}{2} \int x \cos ^2(x) \, dx+3 \int x^2 \cot (x) \, dx-\int x^3 \, dx \\ & = -i x^3-\frac {3 x^4}{8}+\frac {3 \cos ^2(x)}{8}-\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)+\frac {3}{4} x \cos (x) \sin (x)-\frac {1}{2} x^3 \cos (x) \sin (x)-6 i \int \frac {e^{2 i x} x^2}{1-e^{2 i x}} \, dx+\frac {3 \int x \, dx}{4} \\ & = \frac {3 x^2}{8}-i x^3-\frac {3 x^4}{8}+\frac {3 \cos ^2(x)}{8}-\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)+3 x^2 \log \left (1-e^{2 i x}\right )+\frac {3}{4} x \cos (x) \sin (x)-\frac {1}{2} x^3 \cos (x) \sin (x)-6 \int x \log \left (1-e^{2 i x}\right ) \, dx \\ & = \frac {3 x^2}{8}-i x^3-\frac {3 x^4}{8}+\frac {3 \cos ^2(x)}{8}-\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)+3 x^2 \log \left (1-e^{2 i x}\right )-3 i x \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {3}{4} x \cos (x) \sin (x)-\frac {1}{2} x^3 \cos (x) \sin (x)+3 i \int \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \, dx \\ & = \frac {3 x^2}{8}-i x^3-\frac {3 x^4}{8}+\frac {3 \cos ^2(x)}{8}-\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)+3 x^2 \log \left (1-e^{2 i x}\right )-3 i x \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {3}{4} x \cos (x) \sin (x)-\frac {1}{2} x^3 \cos (x) \sin (x)+\frac {3}{2} \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,x)}{x} \, dx,x,e^{2 i x}\right ) \\ & = \frac {3 x^2}{8}-i x^3-\frac {3 x^4}{8}+\frac {3 \cos ^2(x)}{8}-\frac {3}{4} x^2 \cos ^2(x)-x^3 \cot (x)+3 x^2 \log \left (1-e^{2 i x}\right )-3 i x \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {3}{2} \operatorname {PolyLog}\left (3,e^{2 i x}\right )+\frac {3}{4} x \cos (x) \sin (x)-\frac {1}{2} x^3 \cos (x) \sin (x) \\ \end{align*}
Time = 0.80 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.93 \[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\frac {1}{16} \left (-2 i \pi ^3+16 i x^3-6 x^4+3 \cos (2 x)-6 x^2 \cos (2 x)-16 x^3 \cot (x)+48 x^2 \log \left (1-e^{-2 i x}\right )+48 i x \operatorname {PolyLog}\left (2,e^{-2 i x}\right )+24 \operatorname {PolyLog}\left (3,e^{-2 i x}\right )+6 x \sin (2 x)-4 x^3 \sin (2 x)\right ) \]
[In]
[Out]
Time = 3.78 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.34
method | result | size |
risch | \(-\frac {3 x^{4}}{8}+\frac {i \left (4 x^{3}+6 i x^{2}-6 x -3 i\right ) {\mathrm e}^{2 i x}}{32}-\frac {i \left (4 x^{3}-6 i x^{2}-6 x +3 i\right ) {\mathrm e}^{-2 i x}}{32}-\frac {2 i x^{3}}{{\mathrm e}^{2 i x}-1}-2 i x^{3}+3 x^{2} \ln \left ({\mathrm e}^{i x}+1\right )-6 i x \operatorname {polylog}\left (2, -{\mathrm e}^{i x}\right )+6 \operatorname {polylog}\left (3, -{\mathrm e}^{i x}\right )+3 x^{2} \ln \left (1-{\mathrm e}^{i x}\right )-6 i x \operatorname {polylog}\left (2, {\mathrm e}^{i x}\right )+6 \operatorname {polylog}\left (3, {\mathrm e}^{i x}\right )\) | \(150\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 244 vs. \(2 (84) = 168\).
Time = 0.28 (sec) , antiderivative size = 244, normalized size of antiderivative = 2.18 \[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\frac {4 \, {\left (2 \, x^{3} - 3 \, x\right )} \cos \left (x\right )^{3} + 24 \, x^{2} \log \left (\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) + 24 \, x^{2} \log \left (\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) + 24 \, x^{2} \log \left (-\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) + 24 \, x^{2} \log \left (-\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) - 48 i \, x {\rm Li}_2\left (\cos \left (x\right ) + i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 48 i \, x {\rm Li}_2\left (\cos \left (x\right ) - i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 48 i \, x {\rm Li}_2\left (-\cos \left (x\right ) + i \, \sin \left (x\right )\right ) \sin \left (x\right ) - 48 i \, x {\rm Li}_2\left (-\cos \left (x\right ) - i \, \sin \left (x\right )\right ) \sin \left (x\right ) - 12 \, {\left (2 \, x^{3} - x\right )} \cos \left (x\right ) - 3 \, {\left (2 \, x^{4} + 2 \, {\left (2 \, x^{2} - 1\right )} \cos \left (x\right )^{2} - 2 \, x^{2} + 1\right )} \sin \left (x\right ) + 48 \, {\rm polylog}\left (3, \cos \left (x\right ) + i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 48 \, {\rm polylog}\left (3, \cos \left (x\right ) - i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 48 \, {\rm polylog}\left (3, -\cos \left (x\right ) + i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 48 \, {\rm polylog}\left (3, -\cos \left (x\right ) - i \, \sin \left (x\right )\right ) \sin \left (x\right )}{16 \, \sin \left (x\right )} \]
[In]
[Out]
\[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\int x^{3} \cos ^{2}{\left (x \right )} \cot ^{2}{\left (x \right )}\, dx \]
[In]
[Out]
Exception generated. \[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\int { x^{3} \cos \left (x\right )^{2} \cot \left (x\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int x^3 \cos ^2(x) \cot ^2(x) \, dx=\int x^3\,{\cos \left (x\right )}^2\,{\mathrm {cot}\left (x\right )}^2 \,d x \]
[In]
[Out]